Ext.namespace("myapp");

myapp.init = function() {
   // do some stuff here
}

myapp.shutdown = function() {
}

myapp.utils = function() {
   return {
      cloneObject : function(obj) {
         var clone = {};

         for (var p in obj) {
            if (typeof obj[p] === "object") {
               clone[p] = arguments.callee(obj[p]);
            } else {
               clone[p] = obj[p];
            }
         }

         return clone;
      },

      binarySearch : function(arr, value) {
         var low = 0;
         var high = arr.length - 1;

         while (low <= hight) {
            mid = parseInt((low + high) / 2);
            
            if (arr[mid] == value) {
               return mid;
            } else if (arr[mid] < value) {
               low = mid + 1;
            } else {
               hight = mid - 1;
            }
         }

         return -1;
      }
   }
}();
